package interfaceTest;

public class TestPayment {
    public static void main(String[] args) {
        // 创建支付方式对象
        Payment creditCard = new CreditCardPayment();
        Payment mobile = new MobilePayment();

        // 执行支付并打印详情
        System.out.println("---- 信用卡支付 ----");
        creditCard.pay(200.0);
        creditCard.printPaymentDetails(200.0);

        System.out.println("\n---- 移动支付 ----");
        mobile.pay(150.0);
        mobile.printPaymentDetails(150.0);
    }
}
